-
Notifications
You must be signed in to change notification settings - Fork 13.8k
needs_help: wip fix 146190 #147484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
sgasho
wants to merge
1
commit into
rust-lang:master
Choose a base branch
from
sgasho:fix/141690_check_expr_if
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
needs_help: wip fix 146190 #147484
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
at least this test case fails for incorrect error span. tests/ui/expr/if/if-else-chain-missing-else.rs |
The job Click to see the possible cause of the failure (guessed by this bot)
|
internal compile error occurs with the code below fn main() {
let oa = Some(1);
let oa2 = Some(1);
let oa3 = Some(1);
let v = if let Some(a) = oa {
Some(&a)
} else if let Some(a) = oa2 {
&Some(a)
} else if let Some(a) = oa3 {
&Some(a)
} else {
None
};
println!("{v:?}");
} Output for cargo +stage1 run rust-playground % cargo +stage1 run
Compiling rust-playground v0.1.0 (/Users/suganoshota/Desktop/rust-playground)
error: internal compiler error: compiler/rustc_middle/src/ty/typeck_results.rs:332:13: node_type: no type for node HirId(DefId(0:3 ~ rust_playground[f03d]::main).54) (expr `if let Some(a) = oa3 {
&Some(a)
} else {
None
}`)
thread 'rustc' panicked at compiler/rustc_middle/src/ty/typeck_results.rs:332:13:
Box<dyn Any>
stack backtrace:
0: begin_panic<rustc_errors::ExplicitBug>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:769:5
1: panic_any<rustc_errors::ExplicitBug>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panic.rs:260:5
2: emit_producing_guarantee
at /Users/suganoshota/Desktop/rust/compiler/rustc_errors/src/diagnostic.rs:63:9
3: emit<rustc_errors::diagnostic::BugAbort>
at /Users/suganoshota/Desktop/rust/compiler/rustc_errors/src/diagnostic.rs:1400:9
4: bug<alloc::string::String>
at /Users/suganoshota/Desktop/rust/compiler/rustc_errors/src/lib.rs:1226:30
5: {closure#0}<rustc_span::span_encoding::Span>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/util/bug.rs:39:48
6: {closure#0}<rustc_middle::util::bug::opt_span_bug_fmt::{closure_env#0}<rustc_span::span_encoding::Span>, !>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/ty/context/tls.rs:136:23
7: with_context_opt<rustc_middle::ty::context::tls::with_opt::{closure_env#0}<rustc_middle::util::bug::opt_span_bug_fmt::{closure_env#0}<rustc_span::span_encoding::Span>, !>, !>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/ty/context/tls.rs:79:18
8: with_opt<rustc_middle::util::bug::opt_span_bug_fmt::{closure_env#0}<rustc_span::span_encoding::Span>, !>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/ty/context/tls.rs:134:5
9: opt_span_bug_fmt<rustc_span::span_encoding::Span>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/util/bug.rs:33:5
10: bug_fmt
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/util/bug.rs:16:5
11: {closure#0}
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/macros.rs:18:9
12: unwrap_or_else<rustc_middle::ty::Ty, rustc_middle::ty::typeck_results::{impl#0}::node_type::{closure_env#0}>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/option.rs:1060:21
13: node_type
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/ty/typeck_results.rs:331:32
14: expr_ty
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/ty/typeck_results.rs:374:14
15: note_error_origin
at /Users/suganoshota/Desktop/rust/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs:635:22
16: note_type_err
at /Users/suganoshota/Desktop/rust/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs:1922:14
17: report_and_explain_type_error
at /Users/suganoshota/Desktop/rust/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs:2097:14
18: report_mismatched_types
at /Users/suganoshota/Desktop/rust/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs:158:14
19: coerce_inner<&rustc_hir::hir::Expr, rustc_hir_typeck::_if::{impl#1}::coerce_if_arm::{closure_env#0}>
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/coercion.rs:1739:46
20: coerce_if_arm
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/_if.rs:236:16
21: evaluate_if_chain_with_final_else
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/_if.rs:177:18
22: check_expr_if
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/_if.rs:81:14
23: check_expr_kind
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/expr.rs:588:22
24: {closure#0}
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/expr.rs:282:23
25: maybe_grow<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at /Users/suganoshota/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/stacker-0.1.21/src/lib.rs:57:9
26: ensure_sufficient_stack<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at /Users/suganoshota/Desktop/rust/compiler/rustc_data_structures/src/stack.rs:21:5
27: check_expr_with_expectation_and_args
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/expr.rs:277:18
28: check_expr_with_expectation
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/expr.rs:222:14
29: check_expr_coercible_to_type_or_error<rustc_hir_typeck::expr::{impl#0}::check_expr_coercible_to_type::{closure_env#0}>
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/expr.rs:153:23
30: check_expr_coercible_to_type
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/expr.rs:143:14
31: check_decl_initializer
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1839:18
32: check_decl
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1849:32
33: check_decl_local
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1884:23
34: check_stmt
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1908:22
35: {closure#0}
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1989:22
36: with_breakable_ctxt<rustc_hir_typeck::fn_ctxt::checks::{impl#0}::check_expr_block::{closure_env#0}, ()>
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs:1531:22
37: check_expr_block
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1987:31
38: check_expr_kind
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/expr.rs:574:46
39: {closure#0}
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/expr.rs:282:23
40: maybe_grow<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at /Users/suganoshota/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/stacker-0.1.21/src/lib.rs:57:9
41: ensure_sufficient_stack<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at /Users/suganoshota/Desktop/rust/compiler/rustc_data_structures/src/stack.rs:21:5
42: check_expr_with_expectation_and_args
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/expr.rs:277:18
43: check_expr_with_expectation
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/expr.rs:222:14
44: check_expr_with_hint
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/expr.rs:177:14
45: check_return_or_body_tail
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/expr.rs:1131:35
46: check_fn
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/check.rs:130:9
47: {closure#0}
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/lib.rs:182:9
48: typeck_with_inspect
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_hir_typeck/src/lib.rs:107:1
49: {closure#0}
at /Users/suganoshota/Desktop/rust/compiler/rustc_query_impl/src/plumbing.rs:294:9
[... omitted 33 frames ...]
50: query_ensure<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::dep_graph::graph::DepNodeIndex>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/query/plumbing.rs:198:9
51: typeck<rustc_span::def_id::LocalDefId>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/query/plumbing.rs:233:9
52: {closure#2}
at /Users/suganoshota/Desktop/rust/compiler/rustc_hir_analysis/src/lib.rs:243:29
53: {closure#0}<rustc_hir_analysis::check_crate::{closure_env#2}>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/hir/map.rs:340:79
54: {closure#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_data_structures/src/sync/parallel.rs:181:30
55: call_once<(), rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/panic/unwind_safe.rs:272:9
56: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>, ()>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:589:40
57: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:552:19
58: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>, ()>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panic.rs:359:14
59: run<(), rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_data_structures/src/sync/parallel.rs:23:9
60: {closure#1}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_data_structures/src/sync/parallel.rs:181:23
61: for_each<rustc_span::def_id::LocalDefId, rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure_env#1}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/slice/iter/macros.rs:277:21
62: {closure#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_data_structures/src/sync/parallel.rs:180:27
63: parallel_guard<(), rustc_data_structures::sync::parallel::par_for_each_in::{closure_env#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_data_structures/src/sync/parallel.rs:39:15
64: par_for_each_in<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_data_structures/src/sync/parallel.rs:175:5
65: par_hir_body_owners<rustc_hir_analysis::check_crate::{closure_env#2}>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/hir/map.rs:340:9
66: check_crate
at /Users/suganoshota/Desktop/rust/compiler/rustc_hir_analysis/src/lib.rs:221:9
67: run_required_analyses
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_interface/src/passes.rs:1082:5
68: analysis
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_interface/src/passes.rs:1143:5
69: {closure#0}
at /Users/suganoshota/Desktop/rust/compiler/rustc_query_impl/src/plumbing.rs:294:9
[... omitted 33 frames ...]
70: query_ensure<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/query/plumbing.rs:198:9
71: analysis
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/query/plumbing.rs:233:9
72: {closure#2}
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_driver_impl/src/lib.rs:371:29
73: {closure#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_interface/src/passes.rs:1017:27
74: {closure#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/ty/context.rs:1619:37
75: {closure#0}<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/ty/context/tls.rs:60:9
76: try_with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/thread/local.rs:315:12
77: with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/thread/local.rs:279:20
78: enter_context<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/ty/context/tls.rs:57:9
79: enter<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/ty/context.rs:1619:9
80: create_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_middle/src/ty/context.rs:1824:13
81: {closure#2}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_interface/src/passes.rs:984:9
82: call_once<rustc_interface::passes::create_and_enter_global_ctxt::{closure_env#2}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, (&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2})>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/ops/function.rs:253:5
83: call_once<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}), dyn core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}), Output=core::option::Option<rustc_interface::queries::Linker>>, alloc::alloc::Global>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/alloc/src/boxed.rs:1971:9
84: create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_interface/src/passes.rs:1025:5
85: {closure#0}
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_driver_impl/src/lib.rs:344:22
86: {closure#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_interface/src/interface.rs:531:80
87: call_once<(), rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/panic/unwind_safe.rs:272:9
88: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>, ()>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:589:40
89: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:552:19
90: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>, ()>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panic.rs:359:14
91: {closure#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_interface/src/interface.rs:531:23
92: {closure#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_interface/src/util.rs:201:17
93: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_interface/src/util.rs:155:24
94: set<rustc_span::SessionGlobals, rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>, ()>
at /Users/suganoshota/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/scoped-tls-1.0.1/src/lib.rs:137:9
95: create_session_globals_then<(), rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>>
at /Users/suganoshota/Desktop/rust/compiler/rustc_span/src/lib.rs:146:21
96: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>
at /Volumes/WD_BLACK_SN850X_HS_1TB/rust/compiler/rustc_interface/src/util.rs:151:17
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: please make sure that you have updated to the latest nightly
note: please attach the file at `/Users/suganoshota/Desktop/rust-playground/rustc-ice-2025-10-09T16_39_50-62937.txt` to your bug report
note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [typeck] type-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `rust-playground` (bin "rust-playground")
Caused by:
process didn't exit successfully: `/Users/suganoshota/.rustup/toolchains/stage1/bin/rustc --crate-name rust_playground --edition=2024 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=129 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=6488809a0c223ebf -C extra-filename=-50466f48c4c24bbc --out-dir /Users/suganoshota/Desktop/rust-playground/target/debug/deps -C incremental=/Users/suganoshota/Desktop/rust-playground/target/debug/incremental -L dependency=/Users/suganoshota/Desktop/rust-playground/target/debug/deps` (exit status: 101)
rust-playground % |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
related: issue #146190
hmm...I'm not confident at all. I've encountered so many build failures, runtime errors, etc(this commit passes build process anyway). As a rustc beginner, I'm overwhelmed by the flood of information and am struggling to fix this issue in a proper way.
I would appreciate it if someone could review the changes in this commit and provide guidance on the appropriate direction for the fix or any considerations that should be taken into account.
Zulip: https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Struggling.20to.20fix.20issue.20.23146190.20check_expr_if/with/540960074